package org.mzyyn.qr.controller;

import org.checkerframework.checker.units.qual.A;
import org.mzyyn.qr.dto.auction.BidDTO;
import org.mzyyn.qr.dto.auction.BidListDTO;
import org.mzyyn.qr.dto.goods.PageQueryDTO;
import org.mzyyn.qr.service.auction.AuctionService;
import org.qr.xiaocao.common.entity.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 拍卖表 前端控制器
 * </p>
 *
 * @author lipeng
 * @since 2024-09-23
 */
@RestController
@RequestMapping("/applets")
public class AuctionController {
    @Autowired
    AuctionService auctionService;
    /**
     * 出价
     * @return
     */
    @PostMapping("/auction/bid")
    public BaseResult bid(
            @RequestBody @Validated BidDTO bidDTO
    ){
        return BaseResult.ok(auctionService.bid(bidDTO));
    }

    /**
     * 出价列表
     * @return
     */
    @PostMapping("/auction/bidlist")
    public BaseResult bidlist(
            @RequestBody @Validated BidListDTO bidListDTO
    ){

        return BaseResult.ok(auctionService.bidlist(bidListDTO));
    }
}
